package com.way.designpatterncodepratice.factory.abstractFactory;

/**
 * @author liangliwei 80551025
 * @description
 * @date 2020-06-22
 */
public class Main {
    public static void main(String[] args) {
        /**
         * 传统方法耦合度太高而且违反开闭原则
         * 如果增加pizza 每家店都要修改orderPizza() 方法 增加pizza种类
         */
//        String locale = "china";
        String locale = "italy";
        if ("china".equals(locale)) {

            ChinaPizzaStore chinaPizzaStore = new ChinaPizzaStore(new ChinaFactoryMethodFactory());
            chinaPizzaStore.orderPizza();
        } else {

            ItalyPizzaStore italyPizzaStore = new ItalyPizzaStore(new ItalyFactoryMethodFactory());
            italyPizzaStore.orderPizza();
        }
    }
}
